package day14;

/**
 * 题目:计算日期到天数转换
 * 链接:https://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded?tpId=37&&tqId=21296&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int y = scanner.nextInt();
        int m = scanner.nextInt();
        int d = scanner.nextInt();
        int[] day = {31,59,90, 120, 151, 181, 212,243, 273, 304, 334, 365};
        int sum = 0;
        if(m >= 2) {
            sum += day[m-2];
        }
        //拿到当月前的天数,然后加输入的天数
        sum += d;
        //如果超过2月,就要判断是否是闰年(要加1)
        if(m>2) {
            if(y % 400 == 0 || y % 4 == 0 && y % 100 != 0) {
                sum += 1;
            }
        }
        System.out.println(sum);
    }
}
